package ru.dadle8.service.impl.action.training;

import org.springframework.stereotype.Service;
import org.telegram.telegrambots.meta.api.objects.Update;
import org.telegram.telegrambots.meta.exceptions.TelegramApiException;
import ru.dadle8.model.bot.entity.State;
import ru.dadle8.model.bot.type.Action;
import ru.dadle8.model.bot.type.CommandState;
import ru.dadle8.service.impl.action.AbstractActionService;

@Service
public class TrainingActionServiceImpl extends AbstractActionService {

    @Override
    public String getAction() {
        return Action.TRAINING.getAction();
    }

    @Override
    public void processUpdate(Update update) throws TelegramApiException {
        getStorage().updateState(new State(1000, CommandState.TRAINING, getChatId()));
        getBot().execute(getMessageHelper().sendMessage(getChatId(), "Выбери тренировку", getKeyboardService().getDefaultKeyBoard()));
    }
}
